package com.sixth.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sixth.dao.BusCarDao;
import com.sixth.entity.BusCar;
import com.sixth.service.BusCarService;
import com.sixth.util.TableLayUi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: carrent
 * @description:
 * @author: 老魏
 * @create: 2022-01-14 17:19
 **/
@Service("/BusRentService")
public class BusCarServiceImpl  implements BusCarService {
    @Autowired
    private BusCarDao busCarDao;
    @Override
    //展示全部加跟据身份证号查询
    public TableLayUi listByCondition (int page, int limit, String identity){
        PageHelper.startPage(page,limit);
        List<BusCar> bus= busCarDao.listByCondition(identity);
        PageInfo<BusCar> pageInfo= new PageInfo<BusCar>(bus);
        return new  TableLayUi(0,"",pageInfo.getTotal(),pageInfo.getList());
    }
}
